﻿using System;

namespace Exchange
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("========= C# Exchange =========");

            decimal usd_to_amd = 484;
            decimal amd_to_usd = 487;

            decimal eur_to_amd = 538;
            decimal amd_to_eur = 543;

            Console.Write("Amount: ");
            decimal amount = decimal.Parse(Console.ReadLine());

            /*
            Console.Write("From: ");
            string directionFrom = Console.ReadLine();

            Console.Write("To: ");
            string directionTo = Console.ReadLine();

            string direction = directionFrom.ToUpper() + "-" + directionTo.ToUpper();
            */

            Console.Write("Direction: ");
            string direction = Console.ReadLine();

            decimal result = 0m;
            bool isCorrectDirection = true;

            switch (direction)
            {
                case "USD-AMD":
                    result = amount * usd_to_amd;
                    break;
                case "AMD-USD":
                    result = amount / amd_to_usd;
                    break;
                case "EUR-AMD":
                    result = amount * eur_to_amd;
                    break;
                case "AMD-EUR":
                    result = amount / amd_to_eur;
                    break;
                default:
                    isCorrectDirection = false;
                    break;
            }

            if(isCorrectDirection)
            {
                Console.WriteLine("Result: " + result);
            }
            else
            {
                Console.WriteLine("ERROR: Unknown direction!");
            }

            Console.ReadKey();
        }
    }
}
